package edu.hubu.dao.impl;

import edu.hubu.model.Token;
import net.moon.jpa.dao.IBaseDao;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

/**
 * @author moonlan
 * @date 2020/10/18 上午11:53
 */
@Repository
public interface ITokenDao extends IBaseDao<Token, String> {

    Token findByTokenToken(String tokenToken);

    @Query(value = "select * from token where token_user_id = ?1 and token_is_deleted = 0 and token_is_forbidden = 0", nativeQuery = true)
    Token findByUserId(String userId);
}
